<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>轮回之牢: D:/Code/cProgram/CPP/Qt/TeamCurriculumDesign/Item/Weapon/BaseWeapon.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">轮回之牢<span id="projectnumber">&#160;0.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_80876d1476b72d92a9650b7ee3516e4c.html">TeamCurriculumDesign</a></li><li class="navelem"><a class="el" href="dir_7b149e5ebf6d24756f03bb71c9a9b2ab.html">Item</a></li><li class="navelem"><a class="el" href="dir_75ca77a97de27d1f264eeb7645d44f5f.html">Weapon</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">BaseWeapon.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">//</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment">// Created by lenovo on 2021/8/29.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment">//</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#ifndef TEAMCURRICULUMDESIGN_BASEWEAPON_H</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="preprocessor">#define TEAMCURRICULUMDESIGN_BASEWEAPON_H</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#include &lt;QString&gt;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &quot;../BaseItem.h&quot;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="class_base_weapon.html">   14</a></span><span class="keyword">class </span><a class="code hl_class" href="class_base_weapon.html">BaseWeapon</a> : <span class="keyword">public</span> <a class="code hl_class" href="class_base_item.html">BaseItem</a> {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span>    <span class="keywordtype">int</span> <a class="code hl_function" href="class_base_weapon.html#afe67d40a1e22f6f9df7281e9e5f28ca8">getAttackPower</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="class_base_weapon.html#a61b944f73543b70056c3a512fdc09101">   25</a></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_weapon.html#a61b944f73543b70056c3a512fdc09101">attack_power</a>;<span class="comment">//攻击力</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="class_base_weapon.html#aa2c7219c26a6c64af698d5e5bcfa9c20">   29</a></span><span class="comment"></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_weapon.html#aa2c7219c26a6c64af698d5e5bcfa9c20">attack_range</a>;<span class="comment">//攻击范围</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="class_base_weapon.html#a56c8283fa9cfee3db2c55048365267c1">   33</a></span><span class="comment"></span>    <span class="keywordtype">bool</span> <a class="code hl_variable" href="class_base_weapon.html#a56c8283fa9cfee3db2c55048365267c1">is_long_range</a>;<span class="comment">//是否远程武器</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="class_base_weapon.html#aa1ca5aae6aebb167036c4a15a27a01a9">   37</a></span><span class="comment"></span>    <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_weapon.html#aa1ca5aae6aebb167036c4a15a27a01a9">attack_interval</a>;<span class="comment">//攻击间隔</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="class_base_weapon.html#ae26a871a2cdcf9412a51d65d4668fa73">   41</a></span><span class="comment"></span>    <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_weapon.html#ae26a871a2cdcf9412a51d65d4668fa73">attack_last</a>;<span class="comment">//攻击持续间隔</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"><a class="line" href="class_base_weapon.html#a5c9acec299f50b19312af602e94c2fdb">   45</a></span><span class="comment"></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_weapon.html#a5c9acec299f50b19312af602e94c2fdb">attack_remain</a> = 0;<span class="comment">//控制攻击间隔</span></div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="class_base_weapon.html#a7be4645068ef7b0adf1476a93639cc6f">   49</a></span><span class="comment"></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_weapon.html#a7be4645068ef7b0adf1476a93639cc6f">attack_last_remain</a> = 0;<span class="comment">//控制攻击持续使用</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="class_base_weapon.html#a360f324f814d0c08f5d0cd3a6dcc27be">   53</a></span><span class="comment"></span>    <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_weapon.html#a360f324f814d0c08f5d0cd3a6dcc27be">knock_back_instance</a>;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span> </div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>    <a class="code hl_class" href="class_base_weapon.html">BaseWeapon</a>(<span class="keywordtype">int</span> attackPower, <span class="keywordtype">int</span> attackRange, <span class="keywordtype">bool</span> isLongRange, <span class="keywordtype">int</span> attackInterval, <span class="keywordtype">int</span> knockBackInstance,</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>               <span class="keywordtype">int</span> attackLast, <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_item.html#ae7cede2e9984e90cba978a02045adcc9">max_durability</a>, <span class="keywordtype">bool</span> <a class="code hl_variable" href="class_base_item.html#aec06711b8f4551614a43facd072a3e6e">unbreakable</a>, <span class="keywordtype">int</span> <a class="code hl_variable" href="class_base_item.html#a3d966b5252386cad87a1aba61cd3c65c">drop_probability</a> = 0);</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_base_weapon.html#a40570e8f727b2adeda5214e0f96d4b7b">refresh</a>();</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span> </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>    <span class="keywordtype">bool</span> <a class="code hl_function" href="class_base_weapon.html#aea0c54d392f379356f5eea54ce6001db">canUse</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span> </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>    <a class="code hl_class" href="class_base_weapon.html">~BaseWeapon</a>() <span class="keyword">override</span>;</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span> </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>};</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span> </div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span> </div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span><span class="preprocessor">#endif </span><span class="comment">//TEAMCURRICULUMDESIGN_BASEWEAPON_H</span></div>
<div class="ttc" id="aclass_base_item_html"><div class="ttname"><a href="class_base_item.html">BaseItem</a></div><div class="ttdoc">物品基类</div><div class="ttdef"><b>Definition:</b> BaseItem.h:13</div></div>
<div class="ttc" id="aclass_base_item_html_a3d966b5252386cad87a1aba61cd3c65c"><div class="ttname"><a href="class_base_item.html#a3d966b5252386cad87a1aba61cd3c65c">BaseItem::drop_probability</a></div><div class="ttdeci">int drop_probability</div><div class="ttdoc">掉落概率，单位：百分之掉落概率</div><div class="ttdef"><b>Definition:</b> BaseItem.h:23</div></div>
<div class="ttc" id="aclass_base_item_html_ae7cede2e9984e90cba978a02045adcc9"><div class="ttname"><a href="class_base_item.html#ae7cede2e9984e90cba978a02045adcc9">BaseItem::max_durability</a></div><div class="ttdeci">int max_durability</div><div class="ttdoc">最大耐久度，不可破坏的物品可能为任意负值</div><div class="ttdef"><b>Definition:</b> BaseItem.h:39</div></div>
<div class="ttc" id="aclass_base_item_html_aec06711b8f4551614a43facd072a3e6e"><div class="ttname"><a href="class_base_item.html#aec06711b8f4551614a43facd072a3e6e">BaseItem::unbreakable</a></div><div class="ttdeci">bool unbreakable</div><div class="ttdoc">是否可以破坏</div><div class="ttdef"><b>Definition:</b> BaseItem.h:43</div></div>
<div class="ttc" id="aclass_base_weapon_html"><div class="ttname"><a href="class_base_weapon.html">BaseWeapon</a></div><div class="ttdoc">武器基类</div><div class="ttdef"><b>Definition:</b> BaseWeapon.h:14</div></div>
<div class="ttc" id="aclass_base_weapon_html_a360f324f814d0c08f5d0cd3a6dcc27be"><div class="ttname"><a href="class_base_weapon.html#a360f324f814d0c08f5d0cd3a6dcc27be">BaseWeapon::knock_back_instance</a></div><div class="ttdeci">int knock_back_instance</div><div class="ttdoc">武器击退距离</div><div class="ttdef"><b>Definition:</b> BaseWeapon.h:53</div></div>
<div class="ttc" id="aclass_base_weapon_html_a40570e8f727b2adeda5214e0f96d4b7b"><div class="ttname"><a href="class_base_weapon.html#a40570e8f727b2adeda5214e0f96d4b7b">BaseWeapon::refresh</a></div><div class="ttdeci">void refresh()</div><div class="ttdoc">刷新使用间隔</div><div class="ttdef"><b>Definition:</b> BaseWeapon.cpp:8</div></div>
<div class="ttc" id="aclass_base_weapon_html_a56c8283fa9cfee3db2c55048365267c1"><div class="ttname"><a href="class_base_weapon.html#a56c8283fa9cfee3db2c55048365267c1">BaseWeapon::is_long_range</a></div><div class="ttdeci">bool is_long_range</div><div class="ttdoc">武器是否为远程武器，暂时无用</div><div class="ttdef"><b>Definition:</b> BaseWeapon.h:33</div></div>
<div class="ttc" id="aclass_base_weapon_html_a5c9acec299f50b19312af602e94c2fdb"><div class="ttname"><a href="class_base_weapon.html#a5c9acec299f50b19312af602e94c2fdb">BaseWeapon::attack_remain</a></div><div class="ttdeci">int attack_remain</div><div class="ttdoc">武器攻击间隔的控制变量</div><div class="ttdef"><b>Definition:</b> BaseWeapon.h:45</div></div>
<div class="ttc" id="aclass_base_weapon_html_a61b944f73543b70056c3a512fdc09101"><div class="ttname"><a href="class_base_weapon.html#a61b944f73543b70056c3a512fdc09101">BaseWeapon::attack_power</a></div><div class="ttdeci">int attack_power</div><div class="ttdoc">武器攻击力</div><div class="ttdef"><b>Definition:</b> BaseWeapon.h:25</div></div>
<div class="ttc" id="aclass_base_weapon_html_a7be4645068ef7b0adf1476a93639cc6f"><div class="ttname"><a href="class_base_weapon.html#a7be4645068ef7b0adf1476a93639cc6f">BaseWeapon::attack_last_remain</a></div><div class="ttdeci">int attack_last_remain</div><div class="ttdoc">武器攻击持续的控制变量</div><div class="ttdef"><b>Definition:</b> BaseWeapon.h:49</div></div>
<div class="ttc" id="aclass_base_weapon_html_aa1ca5aae6aebb167036c4a15a27a01a9"><div class="ttname"><a href="class_base_weapon.html#aa1ca5aae6aebb167036c4a15a27a01a9">BaseWeapon::attack_interval</a></div><div class="ttdeci">const int attack_interval</div><div class="ttdoc">武器攻击间隔</div><div class="ttdef"><b>Definition:</b> BaseWeapon.h:37</div></div>
<div class="ttc" id="aclass_base_weapon_html_aa2c7219c26a6c64af698d5e5bcfa9c20"><div class="ttname"><a href="class_base_weapon.html#aa2c7219c26a6c64af698d5e5bcfa9c20">BaseWeapon::attack_range</a></div><div class="ttdeci">int attack_range</div><div class="ttdoc">武器攻击范围，单位：像素</div><div class="ttdef"><b>Definition:</b> BaseWeapon.h:29</div></div>
<div class="ttc" id="aclass_base_weapon_html_ae26a871a2cdcf9412a51d65d4668fa73"><div class="ttname"><a href="class_base_weapon.html#ae26a871a2cdcf9412a51d65d4668fa73">BaseWeapon::attack_last</a></div><div class="ttdeci">const int attack_last</div><div class="ttdoc">武器攻击持续时间</div><div class="ttdef"><b>Definition:</b> BaseWeapon.h:41</div></div>
<div class="ttc" id="aclass_base_weapon_html_aea0c54d392f379356f5eea54ce6001db"><div class="ttname"><a href="class_base_weapon.html#aea0c54d392f379356f5eea54ce6001db">BaseWeapon::canUse</a></div><div class="ttdeci">bool canUse() const</div><div class="ttdoc">返回武器是否冷却结束可以使用</div><div class="ttdef"><b>Definition:</b> BaseWeapon.cpp:21</div></div>
<div class="ttc" id="aclass_base_weapon_html_afe67d40a1e22f6f9df7281e9e5f28ca8"><div class="ttname"><a href="class_base_weapon.html#afe67d40a1e22f6f9df7281e9e5f28ca8">BaseWeapon::getAttackPower</a></div><div class="ttdeci">int getAttackPower() const</div><div class="ttdoc">获取武器攻击力</div><div class="ttdef"><b>Definition:</b> BaseWeapon.cpp:38</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>
